package com.woniu.util;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

/**
 * @author 李桢
 * @time 2021/01/16 11:16:17
 */

@Data
@AllArgsConstructor
@NoArgsConstructor
public class ResultVO {
    private Integer code;
    private String message;
    private Object data;

    public ResultVO(Integer code, String message) {
        this.code = code;
        this.message = message;
    }

    public static ResultVO success() {
        return new ResultVO(200, "操作成功");
    }
    public static ResultVO success(Object data) {
        return new ResultVO(200, "操作成功", data);
    }

    public static ResultVO failureForNull() { return new ResultVO(400, "参数为空"); }
    public static ResultVO failure() { return new ResultVO(500, "操作失败"); }


}
